from ultralytics import YOLO
# if __name__ == '__main__':
#     model = YOLO(r'C:\Users\15123\Desktop\YOLO\yolo11test\yolo11n.pt')
#     result = model.train(data=r'C:\Users\15123\Desktop\YOLO\yolo11test\chepai.yaml', epochs=50, workers=0, device=0)
#     print(result)

# if __name__ == '__main__':
#     model = YOLO(r'C:\Users\15123\Desktop\YOLO\yolo11test\runs\detect\train7\weights\best.pt')
#     result = model.val(data=r'C:\Users\15123\Desktop\YOLO\yolo11test\car_wrong.yaml')
#     print(result)
if __name__ == '__main__':
    model = YOLO(r'C:\Users\15123\Desktop\YOLO\yolo11test\runs\detect\train11\weights\best.pt')
    result = model.predict(source=r'C:\Users\15123\Desktop\YOLO\yolo11test\datasets\chepai\train\images\0_2_hr_png_jpg.rf.f68666d41d445f8f7cc6399792d5317d.jpg', save=True, show=True)
    print(result)
# if __name__ == '__main__':
#     model = YOLO(r'C:\Users\15123\Desktop\YOLO\yolo11test\runs\detect\train7\weights\best.pt')
#     result = model.export(format='onnx')
#     print(result)
'''
train
yolo mode=train50 model=yolo11n.pt data=coco8.yaml imgsz=640 epochs=100 batch=16
'''
'''
val
yolo mode=val model=yolo11n.pt data=coco8.yaml imgsz=640
'''
'''
predict
yolo mode=predict model=yolo11n.pt source=0
'''
'''
export
yolo mode=export model=yolo11n.pt format=onnx
'''

